package top.zhangjianyong.tools.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.zhangjianyong.tools.entity.guanjiangyuan.House;

import java.util.List;

public interface HouseMapper extends BaseMapper<House> {

    @Select("SELECT DISTINCT h.* from house h left join people p on p.house_no = h.house_no " +
            "where h.house_no like '${key}%' or p.name like '${key}%' or p.id_no like '%${key}%' or p.phone like '%${key}%' " +
            "order by h.update_time desc "
    )
    List<House> searchHouse(@Param("key") String key);
}
